package com.lingyi.system.service.impl;

import com.lingyi.common.annotation.DataScope;
import com.lingyi.common.constant.UserConstants;
import com.lingyi.common.core.domain.entity.SysRole;
import com.lingyi.common.core.domain.entity.SysUser;
import com.lingyi.common.exception.ServiceException;
import com.lingyi.common.utils.SecurityUtils;
import com.lingyi.common.utils.StringUtils;
import com.lingyi.common.utils.bean.BeanValidators;
import com.lingyi.common.utils.spring.SpringUtils;
import com.lingyi.system.domain.SysPost;
import com.lingyi.system.domain.SysUserPost;
import com.lingyi.system.domain.SysUserRole;
import com.lingyi.system.domain.battle.battleTalent;
import com.lingyi.system.mapper.*;
import com.lingyi.system.service.BattleService;
import com.lingyi.system.service.ISysConfigService;
import com.lingyi.system.service.ISysDeptService;
import com.lingyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import javax.validation.Validator;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 用户 业务层处理
 * 
 * @author lingyi
 */
@Service
public class BattleServiceImpl implements BattleService
{
    private static final Logger log = LoggerFactory.getLogger(BattleServiceImpl.class);
    @Autowired
    private BattleMapper battleMapper;
    @Override
    public List<battleTalent> getTalent(int userType) {
        List<battleTalent> list=new LinkedList<>();
//        获取天赋
//        1 红队，2蓝队
        if (userType==1){
            //攻击方天赋对象;
            list = battleMapper.getDefTalent();
        }else if(userType==2){
            //防御方天赋
            list = battleMapper.getAttackTalent();
        }
        return list;
    }
}
